package com.atguigu.Spring5.aopAnno;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

/**
 * @Author xiao hu die
 * @Date 2022/4/1 13:24
 * @Version 1.0
 */
@Component
@Aspect
public class UserProxy {
    @Before(value = " execution (*  com.atguigu.Spring5.aopAnno.*.*(..))")
    public void before(){
    System.out.println("方法之前执行");
    }
    @After(value = "execution(* com.atguigu.Spring5.aopAnno.*.*(..))")
   public void after(){
       System.out.println("方法之后执行");
   }
   @Around(value = "execution(* com.atguigu.Spring5.aopAnno.*.*(..))")
    public void around(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {
       System.out.println("环绕之前");
       proceedingJoinPoint.proceed();
       System.out.println("环绕之后");
    }
}
